<?php
/********************************************************
** Copyright 2010-2013. Todos los derechos reservados. **
** Desarrollado y Gestionado por:					   **
** Sugey Quintero (Analista)						   **
** José G. De Freitas (Programador)					   **
** Klaudia Uribe (Diseñadora Web)					   **
** Cesar Isturiz (Diseñador Web)					   **
**				S E A  v1.0							   **
*********************************************************/

session_start();
include("conexion.php");

	if (isset($_SESSION['name']) and isset($_SESSION['tiempo'])) {
        include("Tiempo.php");
	date_default_timezone_set('America/Caracas'); setlocale(LC_TIME, 'spanish');
	$usuario = $_SESSION['name'];
	$fecha = date("Y-m-d H:i:s");
	$auditoria = mysql_query("INSERT INTO auditoria SELECT '$usuario', '$fecha' , 'Reporte de personal' ");

    }else {
		echo "<script>alert('Debe ingresar al sistema primero');</script>";
		echo "<script>document.location.href='index.php';</script>";
	}

$Cedula=$_GET['Cedula'];
if ($Cedula){
	$sql = mysql_query("SELECT CI_p, Nombres, Apellidos, Cargo FROM personal WHERE CI_p='$Cedula' ");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Reporte de Personal</title>
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico">
<link href="style.css" rel="stylesheet" type="text/css" />
<!-- calendario-->
<link rel="stylesheet" type="text/css" href="src/css/jscal2.css">
<link rel="stylesheet" type="text/css" href="src/css/border-radius.css">
<link rel="stylesheet" type="text/css" href="src/css/steel/steel.css">
<script type="text/javascript" src="src/js/jscal2.js"></script>
<script type="text/javascript" src="src/js/lang/es.js"></script>
<!-- fin calendario-->
<!-- botones-->
<link type="text/css" href="js/css/smoothness/jquery-ui-1.8.16.custom.css" rel="Stylesheet" />      
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script> 
<script>
var j$ = jQuery.noConflict();
j$(document).ready(function(){
j$(".button").button();
});

j$(function(){
	j$('#menu li a').click(function(event){
		var elem = j$(this).next();
		if(elem.is('ul')){
			event.preventDefault();
			j$('#menu ul:visible').not(elem).slideUp();
			elem.slideToggle();
		}
	});
});

<!--
var nav4 = window.Event ? true : false;
function acceptNum(evt){   
var key = nav4 ? evt.which : evt.keyCode;   
return (key <= 13 || (key>= 48 && key <= 57));
}
//-->
</script>
<!-- fin botones-->
</head>

<body>
<div id="wrap">
<div id="header">
<div id="hora">
<?php include("Hora.php"); ?>
</div>
<div id="topnav">
	<?php include("MenuSuperior.php"); ?>
</div>


</div>
<div id="content">
<div id="left">
<div class="post">
<div class="post_h">

</div>

<div class="postcontent">

<script language="JavaScript1.2">
function verifyInput(_selList,_textBox) {
	document.getElementById('Cedula').readOnly = false;
	var SI = eval(_selList+".selectedIndex");
	var SV = eval(_selList+".options[SI].value");
	eval(_textBox+".value = SV");
	var a = eval(_selList+".options.selectedIndex=0");
	document.FormPersonal.Cedula.focus()
}

function habilitar(form) {
	document.getElementById('asistencia').style.display="inline";
}
</script>
<blockquote><h2 align="center">REPORTES</h2></blockquote>
		<fieldset>
			<legend align=left><b><font size=2>BUSCADOR</font></b></legend>
			<form METHOD="GET" ACTION="ReportePersonal.php" name="FormPersonal">
			<center>
			<table width=70% cellspacing=5 cellpadding=0 border=0>
			<tr>
				<td>C&eacute;dula de Identidad: </td>
				<td><select name="Nac" onchange="verifyInput('document.FormPersonal.Nac','document.FormPersonal.Cedula')"><option></option><option>V-</option><option>E-</option></select><input readonly type=text name="Cedula" id="Cedula" size=11 maxLength=10 onKeyUp="comprobar_p(this.value)" onKeyPress='return acceptNum(event)'>
					<input class=button type=submit value=Buscar></td>
			</tr>
			</table>
			</center>
			</form>
		</fieldset>

<div class="post">
<span></span></div>
			
<?php if ($sql){
		echo "<fieldset>";
		echo "<legend align=left><b><font size=2>DATOS PERSONALES</font></b></legend>";
		echo "<table width=100% cellspacing=5 cellpadding=0 border=0>";
			while($row=mysql_fetch_array($sql)){
				echo "<tr>";
				echo "<td width=50%>C&eacute;dula de Identidad: </td><td>$row[0]</td>";
				echo "</tr>";
				echo "<tr>";
				echo "<td>Nombres: </td><td>$row[1]</td>";
				echo "</tr>";
				echo "<tr>";
				echo "<td>Apellidos: </td><td>$row[2]</td>";
				echo "</tr>";
				echo "<tr>";
				echo "<td>Cargo: </td><td>$row[3]</td>";
				echo "</tr>";
			
		echo "</table>";
		echo "</fieldset>";
			
		echo "<div class=post>";
		echo "<span></span></div>";
		
		echo "<fieldset>";
		echo "<legend align=left><b><font size=2>REPORTE A GENERAR</font></b></legend>";
		echo "<table width=100% cellspacing=5 cellpadding=3 border=0>";
			echo "<tr align=center>";
				echo "<td><a href='PdfCertificacionFunciones.php?Cedula=$row[0]' class=button target='_blank'>Certificaci&oacute;n de Funciones</a></td>";
				//echo "<td><input type=button class=button value='Certificaci&oacute;n de Funciones' onClick=\"location='PdfCertificacionFunciones.php?Cedula=$row[0]'\"></td>";
			echo "</tr>";
			echo "<tr align=center>";
				echo "<td><input type=button class=button value='Asistencias' onclick='habilitar(this.form)'></td>";
			echo "</tr>";
			echo "</table>";

		echo "<table width=100% cellspacing=5 cellpadding=3 border=0 id=asistencia style='display: none;'>";
		echo "<form METHOD='GET' ACTION='PdfAsistenciaPersonal.php' target='_blank'>";
			echo "<tr align=right>";
			echo "<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>";
			echo "<td>Fecha Inicio <input readonly type=text id='calendar-inputField' name='F_inicio' size=9><img src='images/calendar.gif' id='calendar-trigger' align=top>
						<script>
							Calendar.setup({
								trigger    : 'calendar-trigger',
								inputField : 'calendar-inputField',
								dateFormat	 : '%d-%m-%Y',
								onSelect   : function() { this.hide() }
							});
						</script>&nbsp;
						Fecha Fin <input readonly type=text id='calendar-inputField2' name='F_fin' size=9><img src='images/calendar.gif' id='calendar-trigger2' align=top>
					<script>
							Calendar.setup({
								trigger    : 'calendar-trigger2',
								inputField : 'calendar-inputField2',
								dateFormat	 : '%d-%m-%Y',
								onSelect   : function() { this.hide() }
							});
						</script>
						<input type=hidden name=Cedula value='$row[0]'>
						<input class=button type=submit value=Buscar></td>";
			echo "</tr>";
			
		echo "</form>";
		echo "</table>";
		}
		
		echo "</fieldset>";
		
		echo "<div class=post>";
		echo "<span></span></div>";
		
		echo "<div name=botonera align=center>";
		echo "<input class=button type=button value=Volver onClick=\"location='index.php'\">";
		echo "</div>";
}
?>

<div align=right><a title='Ayuda' href="Manuales/ManualUsuario_5.2.pdf" onclick="window.open(this.href,'Manual','params'); return false"><img src='images/help.png' width=8% height=15%></a></div>

</div>
<div class="post_b">
<span></span></div>
</div>


</div>

<div class="post">
<div class="post_h">

</div>


</div>

<?php include("Menu.php"); ?>

<div class="clear"></div>
</div>
<div id="pagebottom"></div>

<div id="footer">
<P>&reg; Derechos Reservados @ CopyRight. 2011-2012</P>
<p>Programadores: Quintero E, Isturiz C, Uribe C, De Freitas J.</p>
</div>
</div>
</body>
</html>
